﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<QianBuo.Lottery.Web.Models.PayModels.AilPay_ManualModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
   支付宝
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="icbc_manual_div">
        <fieldset>
            <legend>[<%=Model.AilPayDetail.Name %>]</legend>
            <%=Html.ActionLink("返回修改>>", "AilPayCancelOrder", "Pay", new { Model.Money, PayType = Model.AilPayDetail.PayType, Model.Order }, new { @class = "a_blue", onclick = "return confirm('返回修改则此单将无效，是否离开本页？');" })%>
            <ul class="editlist">
                <li>
                    <span class="label">充值金额:</span>
                    <span><font color="red"><%=Model.Money.ToString("F2") %>元<%=Model.SuccessMoney.HasValue ? string.Format("&nbsp;&nbsp;到账金额:{0:F2}元", Model.SuccessMoney + Model.Money) : "" %></font></span>
                </li>
                <li>
                    <span class="label">支付方式:</span>
                    <span><font color="red">线下手工转账</font></span>
                </li>

                <%if ((!string.IsNullOrEmpty(Model.AilPayDetail.Key)) && (!string.IsNullOrEmpty(Model.AilPayDetail.MumberID)))
                  { %>
                <li>
                    <span class="label">支付宝户名:</span>
                     <span><a class="copy" tabindex="3" href="javascript:;"><%=Model.AilPayDetail.MumberID%></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="#888">[点击可复制]</font></span>

                </li>
                <li>
                    <span class="label">支付宝账号:</span>
                 <span><a class="copy" tabindex="2" href="javascript:;"><%=Model.AilPayDetail.Key%></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="#888">[点击可复制]</font></span>
              
                </li>
                <li>
                    <span class="label">交易订单ID号:</span> 
                    <span><a class="copy" tabindex="1" href="javascript:;"><%=string.IsNullOrEmpty(Model.SiteID) ? "" : Model.SiteID + "-" %><%=Model.Order %></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="#888">[点击可复制，这项填在转账页面的“附言”里]</font></span>
                </li>
                <%} %>
                <li>
                    <span class="label">充值说明:</span>
                    <span class="spans"><font color="red"><%=(Model.AilPayDetail.Addr ?? "").Replace("\r\n", "<br />") %></font></span>
                </li>
            </ul>
        </fieldset>
    </div>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="StyleAndScript" runat="server">
    <script type="text/javascript">
        $(document).ready(function () {
            $("#icbc_manual_div a.copy").click(function () {

                var txt = $(this).text();
                copyToClipboard(txt);
            });

        });

        function copyToClipboard(txt) {
            if (window.clipboardData) {
                window.clipboardData.clearData();
                window.clipboardData.setData("Text", txt);
                alert("复制成功！")
            } else if (navigator.userAgent.indexOf("Opera") != -1) {
                window.location = txt;
                alert("复制成功！")
            } else if (window.netscape) {
                try {
                    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                } catch (e) {
                    alert("被浏览器拒绝！\n请在浏览器地址栏输入'about:config'并回车\n然后将'signed.applets.codebase_principal_support'设置为'true'");
                }
                var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
                if (!clip)
                    return;
                var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
                if (!trans)
                    return;
                trans.addDataFlavor('text/unicode');
                var str = new Object();
                var len = new Object();
                var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
                var copytext = txt;
                str.data = copytext;
                trans.setTransferData("text/unicode", str, copytext.length * 2);
                var clipid = Components.interfaces.nsIClipboard;
                if (!clip)
                    return false;
                clip.setData(trans, null, clipid.kGlobalClipboard);
                alert("复制成功！")
            } else {
                alert("复制失败，换个浏览器试试？");
            }
        }  
    </script>
    <style type="text/css">
        .copy{ text-decoration:underline; color:Blue;}
    </style>
</asp:Content>
